<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 14274
  Date: 2023/8/5
  Time: 21:09
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>管理员系统-查看教师信息</title>
    <link rel="stylesheet" href="css/teacher.css">
</head>
<body>
<!-- body页面主体div -->
<div class="body">


    <!-- sidebar侧边栏div -->
    <div class="sidebar">
        <!-- logo -->
        <div class="logo">
            <h4>校园管理系统</h4>
        </div>
        <!-- functions功能链接 -->
        <ul class="functions">

            <li>
                <dl><dt><img src="imgs/person.png">个人中心
                    <dd><a href="adm-home.jsp">查看信息</a></dd>
                    <dd><a href="#">修改信息</a></dd>
                    </dt>
                </dl>
            </li>

            <li>
                <dl><dt>学生信息
                    <dd><a href="student?methodName=searchs">查看学生信息</a></dd>
                    <dd><a href="#">修改学生信息</a></dd>
                    </dt>
                </dl>
            </li>

            <li>
                <dl><dt>教师信息
                    <dd><a href="teacher?methodName=search">查看教师信息</a></dd>
                    <dd><a href="#">修改教师信息</a></dd>
                    </dt>
                </dl>
            </li>

            <li>
                <dl><dt>查看成绩
                    <dd><a href="stuandpro?methodName=search">专业分类</a></dd>
                    <dd><a href="#">班级分类</a></dd>
                    </dt>
                </dl>
            </li>

            <li>
                <dl><dt>成绩统计
                    <dd><a href="adm-stats.jsp">各课成绩统计图</a></dd>
                    <dd><a href="#">333</a></dd>
                    </dt>
                </dl>
            </li>

            <li>
                <dl><dt><a href="Out?methodName=Out">退出</a>
                </dt></dl>
            </li>

        </ul>
    </div>
    <div class="nav">
        <div class="title">
            <h1>成绩统计</h1>
        </div>
    </div>

    <div class="info">
        <div id="main1" style="width: 20.2rem;height: 5rem;">

        </div>
        <div  style="width: 20.2rem;height: .5rem;text-align: center;font-size: .25rem;">
            <span>各课平均成绩折线图</span>
        </div>
        <div id="main2" style="width: 20.2rem;height: 5rem;">

        </div>
        <div  style="width: 20.2rem;height: .5rem;text-align: center;font-size: .25rem;">
            <span>各课平均成绩柱状图</span>
        </div>

    </div>

</div>

</body>
</html>
<script src="js/jquery-1.12.4.js"></script>
<script src="js/flexible.js"></script>
<script src="js/adm-home.js"></script>
<script src="js/jquery-1.8.3.min.js"></script>
<script src="js/echarts.js"></script>
<script>
    $(function(){

        var chartDom = document.getElementById('main1');
        var myChart = echarts.init(chartDom,"dark");
        var option;
        var angledate = [];
        var ydata = [];
        $.ajax({
            type:"POST",
            url:"project",
            dataType:"JSON",
            async:false,
            success:function(msg){
                for (var i = 0; i < msg.length; i++) {
                    angledate.push(msg[i].course);
                    ydata.push(msg[i].score);
                }
            }
        })
        option = {
            xAxis: {
                type: 'category',
                boundaryGap: false,
                data: angledate
            },
            yAxis: {
                type: 'value'
            },
            series: [
                {
                    data: ydata,
                    type: 'line',
                    areaStyle: {}
                }
            ]
        };

        option && myChart.setOption(option);
    })
    $(function(){
        var chartDom = document.getElementById('main2');
        var myChart = echarts.init(chartDom,"dark");
        var option;
        var xdata = [];
        var ydata = [];
        $.ajax({
            type:"POST",
            url:"project",
            dataType:"JSON",
            async:false,
            success:function(msg){
                for (var i = 0; i < msg.length; i++) {
                    xdata.push(msg[i].course);
                    ydata.push(msg[i].score);
                }
            }
        })

        option = {
            xAxis: {
                type: 'category',
                data: xdata
            },
            yAxis: {
                type: 'value'
            },
            series: [
                {
                    data: ydata,
                    type: 'bar',
                    showBackground: true,
                    backgroundStyle: {
                        color: 'rgba(180, 180, 180, 0.2)'
                    }
                }
            ]
        };

        option && myChart.setOption(option);
    })

    $(function(){

    })

</script>